package com.tensquare.article.repository;


import com.tensquare.article.pojo.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: xxx
 * @Date: 2022/10/26 20:55
 * @Description: 评论持久层
 */
@Repository
//@Mapper
public interface CommenntRepository extends MongoRepository<Comment,String> {
    //SpringDataMongo,支持通过查询方法进行查询定义的方式
    //根据文章id查询文章评论数据
    List<Comment> findByArticleid(String articleId);
    
    //根据发布时间和点赞查询查询
   // List<Comment> findByPublishadateAndThumbup(Date date,Integer thumbup);

    

    //根据用户id查询，并且根据发布时间倒叙排序
    //List<Comment> findByUseridOrderByPublishadateDesc(String userid);

    
}
